<template>
  <div id="HouseBrand" :class="{smallFontSize:showEdition,mediumFontSize:!showEdition}">
    <img @click="saveData" style="margin-bottom: 20px;" width="100%" height="100%" src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/41.png" alt="">
    <div class="list">
      <ul>
        <li
          v-for="(item,index) in listData"
          :key="index"

        >
          <p>
            <img :src="item.icon">
          </p>
          <p>
            <span>{{item.name}}</span>
          </p>
        </li>
      </ul>
    </div>
    <!--<p style="text-align: center;">咨询电话 0571-2935789</p>-->
    <!-- &lt;!&ndash;      <van-button style="margin-right: 10px;" size="small" type="info" @click="getinsertDataView">提交</van-button>&ndash;&gt; -->
    <div style="padding: 0 10px;margin-top: 20px;">
      <van-button @click="saveData" round block type="info" native-type="submit" :class="{smallFontSize:showEdition,mediumFontSize:!showEdition}">申请门牌</van-button>
    </div>
    <!-- <div style="height: 60vh;text-align:center;padding-top: 20vh;">
      <div style="margin-bottom: 10px;">
        <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png">
      </div>
      <div>建设中，敬请期待！</div>
    </div> -->
    <!-- <img width="100%" height="100%" src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/EJIMG/2我要办理地名牌.png" alt=""> -->
  </div>
</template>
<script>
  import { doorplate ,FileServerProxy} from "../../utils/api";
export default {
  name: 'HouseBrand',
  data () {
    return {
      showEdition: false,
      listData: [
        {
          name: '一键办理',
          icon: 'https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/43.png'
        },
        {
          name: '便捷高效',
          icon: 'https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/44.png'
        }
      ]
    };
  },
  methods: {
    getData: async function (){
      let params = {
        "accessCode": "688bd3883572440a859dfd8ba9194e7b",
        "cityCode": "441300000000",
        "params": {
          "dataguid": "6fc68159-3182-4ccb-bf64-b69403f95111",
          "searchObject": JSON.stringify([]),
          token: window.localStorage.getItem('token')
        }
      }
      const res = await FileServerProxy(params);
      let data = JSON.parse(res.data.data).Data
      this.paramsData = data[0]
    },
    saveData : async function () {
      this.$router.push({
        path: '/BrandPage'
      })

      // let params = {
      //   "accessCode": "16c9a20c2f0a4791bf74ead599270a23",
      //   "cityCode": "330000000000",
      //   "params": {
      //     "address": this.paramsData.ADDRESS,
      //     "areaName": "杭州市",
      //     "areaCode": this.paramsData.AREACODE,
      //     "propertyOwnerIdentityNumber": this.paramsData.PROPERTYOWNERIDENTITYNUMBER,
      //     "propertyName": this.paramsData.PROPERTYNAME,
      //     "proposerOwnerIdentityNumber": this.paramsData.PROPOSEROWNERIDENTITYNUMBER,
      //     "proposerName": this.paramsData.PROPOSERNAME,
      //     "proposerTelephone": this.paramsData.PROPOSERTELEPHONE,
      //     "attachmentList": [
      //       {
      //       "name": "农村建房审批表",
      //       "type": "105",
      //       "url": "http://112.124.240.120:28800/PrintServer/api/PreviewWordRpt?groupGuid=%7B9DAD7750-9499-4751-A9E5-84B2EB9D25D0%7D&toRowGuid=0a500c75-a4f3-4280-a9a2-edeb5ed6f643&dataGuid=01103ebf-a884-4282-b996-78dd64196946"
      //       },
      //       {
      //         "name": "农村建房申请表",
      //         "type": "110",
      //         "url": "http://112.124.240.120:28800/PrintServer/api/PreviewWordRpt?groupGuid=%7B46892203-875E-4F7D-A337-CEF6D965CE44%7D&toRowGuid=0a500c75-a4f3-4280-a9a2-edeb5ed6f643&dataGuid=01103ebf-a884-4282-b996-78dd64196946"
      //       }
      //     ],
      //     "id": this.paramsData.ID,
      //     "source": "测试数据",
      //     "token": window.localStorage.getItem('token')
      //   }
      // }
      // const res = await doorplate(params);
    },
    listClick(data){
      switch (data) {
        case '一键办理':
           this.saveData()
          break
      }
    }
  },
  mounted () {
    // this.getData()
    if (ZWJSBridge) {
      ZWJSBridge.setTitle({
        "title": "我要办理地名牌"
      }).then(res => {
      }).catch(err => {
      })
    }
    this.showEdition = this.$store.state.Edition
  },
}
</script>
<style lang="scss" scoped>
#HouseBrand {
  .list ul li {
    float: left;
    width: 50%;
    height: 160px;
    text-align: center;
  }
  .mediumFontSize {
    font-size: 20px;
  }
}
</style>
